Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

Previous Next
Subject: LS2J Java Script Library iText Issue
Feedback Type: Question
Product Area: Notes Client
Technical Area: Application Development
Platform: Windows
Release: 8.5.2
Reproducible: Always

Hello All,

I have seen issues similar to this posted here in the forum, but I don't think the solutions suggested will work in my case.

The situation is that I have a Java Script Library where I'm using iText. I have imported iText 5.0.2 and have the following class

import java.io.FileOutputStream;

import com.itextpdf.text.Document;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.pdf.PdfWriter;
import com.itextpdf.text.pdf.fonts.*;

public class DPD {

public void helloWorld(){
Document document = new Document();
try {
PdfWriter.getInstance(document, new FileOutputStream("c:\\HelloWorld.pdf"));
document.open();
document.add(new Paragraph("Hello World"));
} catch (Exception e) {

}
document.close();
}
}

I'm getting the "Document has no pages" exception and when I debug there seems to be a problem with the code locating the Helvetica font, which is included in the jar.

Since this is a script library, I don't have access to the "Allowed Restricted Operations" setting that is available in an agent (that apparently solves the problem if you have a Java agent). Also, I don't want to deploy the jar file to every machine in the company, so I don't see a way that I can use the JavaUserClasses (unless you can specify a path to the jar file within the notes database).

Is there some way that I can get the script library or LS2J to locate and load the necessary fonts?

Thanks,

Michael Fariborz


Feedback number WEBB8FVR42 created by ~Wei Zekkrother on 04/13/2011

Status: Open
Comments:





Printer-friendly

Search this forum

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS